package com.huixiaodian.ft_user.view.activity;

import android.os.Bundle;
import android.widget.EditText;

import com.huixiaodian.baselibrary.utils.ParamProofUtil;
import com.huixiaodian.baselibrary.view.activity.BaseLibraryActivity;
import com.huixiaodian.baselibrary.widget.HeaderBar;
import com.huixiaodian.ft_user.R;

public class NickNameSetActivity extends BaseLibraryActivity {

    private EditText editText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public int setContentView() {
        return R.layout.activity_nick_name;
    }

    @Override
    public void initActivityView() {
        super.initActivityView();
        editText = findViewById(R.id.et_nickName);
        ((HeaderBar)findViewById(R.id.headerBar)).getOptionTextView().setOnClickListener(v -> {
            submit();
        });

    }

    private void submit(){
        String nickName = editText.getText().toString().trim();
        ((HeaderBar)findViewById(R.id.headerBar)).getOptionTextView().setClickable(false);
        if(ParamProofUtil.isRightNickName(this, nickName)){
           //提交昵称
        }else{
            ((HeaderBar)findViewById(R.id.headerBar)).getOptionTextView().setClickable(true);
        }
    }
}